﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Site.ViewModels.ProductSearchModels>" %>
<%@ Import Namespace="SDT.Model" %>
<%@ Import Namespace="SDT.Site.ViewModels" %>
<div class="bor_cor">
    <div class="bar_blue" style="text-align:center"><%=Html.Encode(Model.ProductType!=null? Model.ProductType.Name:string.Empty) %></div>
    <div class="tinrao_cate">
        <ul>
            <% if (Model.Categories != null && Model.Categories.Count() > 0)
               {                   
                   
                   foreach (var c in Model.Categories)
                   {
                       var path = string.Format("/product/index/{0}/{1}/{2}/{3}/{4}/{5}/{6}/{7}",
                       Model.TypeID.HasValue ? Model.TypeID.Value : 0,
                       c.ID,
                       Model.CityID.HasValue ? Model.CityID.Value : 0,
                       Model.DistrictID.HasValue ? Model.DistrictID.Value : 0,
                       Model.AreaID.HasValue ? Model.AreaID.Value : 0,
                       Model.PriceID.HasValue ? Model.PriceID.Value : 0,
                       Model.ProjectID.HasValue ? Model.ProjectID.Value : 0,
                       Model.TimeID.HasValue ? Model.TimeID.Value : 0);
                       var css = c.ID == Model.CategoryID ? "act" : string.Empty;
                       if (Model.Keyword != null && Model.Keyword != string.Empty) path = path + "?key=" + Model.Keyword;
                    %>
                    <li><a href="<%=path %>" class="<%=css %>"><%= c.Name %></a></li>
                   <%}
               }%>
        </ul>
    </div>
</div>
<div class="clear"></div>